package com.mars.foodserver.controller.admin;

import com.mars.foodserver.response.result.R;
import com.mars.foodserver.service.ISysIgnorePathService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 放行api控制层
 *
 * @Author wq
 * @Date 2021-06-12
 **/
@RestController
@RequestMapping("admin/ignorePath")
@AllArgsConstructor
public class SysIgnorePathController {


    private final ISysIgnorePathService sysIgnorePathService;

    /**
     * 添加放行接口
     *
     * @param path        路径
     * @param description 描述
     * @return R
     */
    @GetMapping("/add")
    public R add(String path, String description) {
        sysIgnorePathService.add(path, description);
        return R.success();
    }

    /**
     * 删除放行接口
     *
     * @param id id
     * @return R
     */
    @GetMapping("/delete")
    public R delete(Integer id) {
        sysIgnorePathService.delete(id);
        return R.success();
    }


}